package ui;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;

import javax.swing.JPanel;

import td.FieldElement;

/*
 * Abstract parent class for all the FieldElementViews.
 * */
public abstract class FieldElementView extends JPanel implements Viewable {

	protected FieldElement fieldElement;
	protected Image image;
	protected Image critImage;
	protected Image fireImage;
	protected Image slowImage;
	
	public FieldElementView(FieldElement fe){
		fieldElement = fe;
	}
	
	public abstract void update();
	
	public void paintComponent(Graphics g){
		super.paintComponents(g);
		Graphics2D g2D = (Graphics2D) g;
		g2D.drawImage(image, 0, 0, this);
	}
}
